473,480 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting the Value of a DropDownList

I have a Repeater that is paginated, and I would like the user to
navigate to each page via a DropDownList. I have set the AutPostBack
attribute to true and written code that fires on the
OnSelectedIndexChange event. However, I am unable to retrieve the
value of the DropDownList after the PostBack. I have tried
dropdown.SelectedValue, dropdown.SelectedItem.Value, and
dropdown.SelectedIndex. None of these returns the page that was
selected pervious to the postback.

Can anyone shed light on this issue?
Thank you!
Jul 22 '05 #1
1 1743
Hi John,
There are 2 possible solutions to this:

1. Use the http referrer server variable to get the last page
2. Cast the control in the repeater as a DropDownList first, then try to get
the selected value information (similar to reading the value of a control in
the edit state of a datagrid).

HTH.
Ck
"John Smith" wrote:
I have a Repeater that is paginated, and I would like the user to
navigate to each page via a DropDownList. I have set the AutPostBack
attribute to true and written code that fires on the
OnSelectedIndexChange event. However, I am unable to retrieve the
value of the DropDownList after the PostBack. I have tried
dropdown.SelectedValue, dropdown.SelectedItem.Value, and
dropdown.SelectedIndex. None of these returns the page that was
selected pervious to the postback.

Can anyone shed light on this issue?
Thank you!

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2256
by: Earl Teigrob | last post by:
I want to write a function where I pass in a reference to a dropdownlist and a "match value" and have it returns the index of the dropdownlist item that matchs (or -1 if there is no match) ...
4
3097
by: Rob Venable | last post by:
Hi all, Can anyone tell me how to retrieve the ID of a selected item from a DropDownList. My query brings back the ID and value and I cycle through the .Read Method to add items to the...
0
1135
by: Tim Zych | last post by:
I'm having problems with a dropdownlist control. I fill the control with values in the page_load event. But when I click the button the dropdownlist control gets cleared out. How do I use a...
6
1731
by: Teep | last post by:
Below is my code for dropdownlist that is populated from a SQL table. After a selection from the ddl, a datagrid is suppose to come up pertaining to the information selected, but I keep getting a...
5
5922
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
1
1736
by: imranabdulaziz | last post by:
Dear All, I am mess with one situation let me explain the scenario. I am making search form where I display 15 field in checkboxlist and user select one or two or three or any no to all field....
0
1057
by: munya | last post by:
I am new in .asp I am trying to use dropdownlist to display values from the database and be able to query the database based on displayed values in a dropdownlist. the prob is when I select any...
2
3302
by: mylog | last post by:
Hi I am having a problem of getting the value from the dynamically generated table and dropdownlist. What I am facing is, I have created a table in the aspx page and now I need to add values to...
3
2297
by: E11esar | last post by:
Hi there. I have created a DropDownList in asp.net with declaration in the aspx file as follows: <asp:DropDownList ID="lbExtractType" runat="server"> <asp:ListItem Value="...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6886
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.